<h1>Banners</h1>

<% unless flash[:success].blank? %>
    <div class="success-box"><p><%= flash[:success] %></p></div>
<% end %>

<% unless flash[:fail].blank? %>
<div class="errors-box" style="display: block !important; margin-bottom: 10px;">
    <span><%= flash[:fail] %></span>
</div>
<% end %>

<% unless @slides.blank? %>
    <p><%= link_to 'Cambiar orden', change_slides_order_path %></p>

    <table>
      <% @slides.each do |slide| %>
        <tr>
            <td><%= image_tag slide.photo(:list) %></td>
            <td><%= link_to 'Eliminar', admin_slide_image_path(slide.id), :method => :delete, :confirm => "¿Está seguro que desea eliminar el banner?" %></td>
        </tr>
      <% end %>
    </table>
<% else %>
    <span>No hay banners cargados.</span>
<% end %>

<p><%= link_to 'Crear banner', new_admin_slide_image_url %></p>